package cn.uc.grapics;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;

public class BitmapItem extends GraphicsItem{
    private Bitmap iBitmap;
    public BitmapItem(Bitmap aBitmap){
        iBitmap = aBitmap;
    }
    
    public void setBitmap(Bitmap aBitmap){
        iBitmap = aBitmap;
    }
    
    public Bitmap getBitmap(){
        return iBitmap;
    }

    @Override
    protected void paint(Canvas aCanvas) {
        // XXX Auto-generated method stub
        aCanvas.drawBitmap(iBitmap, getX(), getY(), mPaint);
    }
    
    public Rect boundingRect(){
       boundingRect = new Rect(getX(), getY(), getX() + iBitmap.getWidth(), getY() + iBitmap.getHeight());
       return boundingRect;
    }

}
